package com.gangan.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gangan.model.CmsWish;
import com.gangan.mapper.CmsWishMapper;
import com.gangan.model.User;
import com.gangan.model.view.CmsWishContentView;
import com.gangan.service.ICmsWishService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2019-08-20
 */
@Service
public class CmsWishServiceImpl extends ServiceImpl<CmsWishMapper, CmsWish> implements ICmsWishService {
        @Autowired
        private CmsWishMapper mapper;

    @Override
    public List<CmsWishContentView> selectUserListPage(Page<CmsWishContentView> pagination) {
        User user = (User)SecurityUtils.getSubject().getSession().getAttribute("user");
        return mapper.selectUserListPage(pagination,user.getId());
    }
}
